<?php
namespace Home\Controller;
use Think\Controller;
class BaseController extends Controller {
	public function _initialize(){
		$Auth = new \Think\Auth();
				  //需要验证的规则列表,支持逗号分隔的权限规则或索引数组
				  $name = MODULE_NAME . '/' .CONTROLLER_NAME.'/'. ACTION_NAME;
				  //当前用户id
				  $uid = $_SESSION['id'];
				  if (!$Auth->check($name, $uid)) {
//				  	$this->show('<h1>无法访问该资源</h1>');
					$this->assign("errorTitle","无权访问");
					$this->assign("errorCode","403");
					$this->assign("errorMessage","请登录具有更高权限的账户操作");
					$this->assign("errorJumpUrl","/");
					$this->assign("errorWaitSecond",5);
					$this->error();
					}
	}
}
?>